<template>
	    <!-- 弹出层 -->
    <div class="modal fade" id="appealDealModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
      		<div class="modal-header">
	            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
	            <h4 class="modal-title" id="myModalLabel">申诉处理</h4>
          	</div>
          	<div class="modal-body">
          	 	<div class="form-horizontal">
					<div class="form-group">
						<label for="" class="col-sm-4 control-label">状态<label style="color: red;">*</label>：</label>
	                  	<div class="col-sm-8">
							<label><input type="radio" name="processStatus" value = "2" v-model="appealDealInfo.processStatus"/>转为有效报备</label>
        					<label><input type="radio" name="processStatus" value = "3" v-model="appealDealInfo.processStatus"/>不通过</label>
						</div>
	                </div>
	                <div class="form-group">
			          	<label for="" class="col-sm-4 control-label">备注&nbsp;：</label>
			          	<div class="col-sm-8">
			            	<textarea class="form-control" id="remark" name="remark" v-model="appealDealInfo.remark" rows="3" placeholder="备注"></textarea>
			          	</div>
		        	</div>
		        	<input type="hidden" v-model="appealDealInfo.id" class="form-control">
              	</div>
          </div>
          <div class="modal-footer">
            <button type="button" v-on:click="appealDealSubmit" v-show="btnShow" class="btn checkedBtn">确定</button>
          </div>
        </div>
      </div>
    </div>
</template>

<script>
	export default{
		//接收父组件的绑定值
		props: ["appealDealInfoX"],
		data() {
			return {
				appealDealInfo:{
                	id:'',
                	processStatus:'',
                	remark:''
                },
				btnShow: true
			}
		},
		mounted() {
		},
		watch: {
		},
		methods: {
			appealDealSubmit() {
				var _self = this;

				if (!_self.appealDealInfo.processStatus) {
					layer.msg('请选择处理状态！');
				}

				var body = {};
				body.params = {
					id:_self.appealDealInfoX.id,
                	processStatus:_self.appealDealInfo.processStatus,
                	remark:_self.appealDealInfo.remark
				};
				_self.btnShow = false;
				var url = _self.utilHelper.apiUrl + "/api/auditCPAppeal";
				_self.$http.post(url, body).then((response) => {
						var resData = response.body.resData;
						var result = resData.result;
						//输出操作信息
						layer.msg(resData.resultMsg, {
							time: 1000
						}, function(){
							//关闭弹出层
							_self.btnShow = true;
							if("1" == result){
								$('#appealDealModal').modal('hide');
								//子组件向父组件传递信号: 调用父组件中对子组件的监听
								_self.$emit('appealDealListener');
							}
							
						});
					}, (response) => {
				});
			}
		}
	}
	
</script>